import 'package:auto_route/annotations.dart';
import 'package:flutter/material.dart';

import '../../config/Config.dart';
import '../../util/CommonUtils.dart';

@RoutePage()
class SettingPage extends StatefulWidget {
  const SettingPage({super.key});

  @override
  State<SettingPage> createState() => _SettingPageState();
}

class _SettingPageState extends State<SettingPage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Colors.white,
        centerTitle: true,
        title: const Text("设置"),
        leading: BackButton(
          onPressed: () {
            Navigator.of(context).pop();
          },
        ),
      ),
      body: Container(
        decoration: BoxDecoration(
          color: Config.colorF8,
        ),
        child: ListView(
          children: [
            Padding(
              padding: const EdgeInsets.only(
                bottom: 16,
                top: 16,
              ),
              child: Container(
                color: Colors.white,
                child: ListTile(
                  title: Text(
                    "关于",
                    style: TextStyle(
                      color: Config.color47,
                    ),
                  ),
                  trailing: Icon(
                    Icons.arrow_forward_ios_rounded,
                    size: 16,
                    color: Config.colorB1,
                  ),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(bottom: 16),
              child: Container(
                color: Colors.white,
                child: ListTile(
                  title: Text(
                    "应用重置",
                    style: TextStyle(
                      color: Config.color47,
                    ),
                  ),
                  trailing: Icon(
                    Icons.arrow_forward_ios_rounded,
                    size: 16,
                    color: Config.colorB1,
                  ),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(bottom: 16),
              child: Container(
                color: Colors.white,
                child: ListTile(
                  title: Text(
                    "清除缓存",
                    style: TextStyle(
                      color: Config.color47,
                    ),
                  ),
                  trailing: Icon(
                    Icons.arrow_forward_ios_rounded,
                    size: 16,
                    color: Config.colorB1,
                  ),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(bottom: 1),
              child: Container(
                color: Colors.white,
                child: ListTile(
                  title: Text(
                    "注销账户",
                    style: TextStyle(
                      color: Config.color47,
                    ),
                  ),
                  trailing: Icon(
                    Icons.arrow_forward_ios_rounded,
                    size: 16,
                    color: Config.colorB1,
                  ),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(bottom: 16),
              child: Container(
                color: Colors.white,
                child: ListTile(
                  leading:
                  CommonUtils.getImageAsset("icon_warn", width: 24,),
                  title: Text(
                      style: TextStyle(
                        fontSize: 14,
                        color: Config.colorAb,
                      ),
                      "请认真阅读注销协议，一旦您接受了注销协议，并点击了确认注销按钮，账户将无法恢复，请慎用此功能!"),
                ),
              ),
            ),
            Padding(
              padding: const EdgeInsets.only(top: 16, left: 24, right: 24),
              child: FilledButton(
                style: ButtonStyle(
                  backgroundColor: WidgetStateProperty.all(
                    Config.color4f9aff,
                  ),
                ),
                onPressed: () {},
                child: const Text("退出登录"),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
